<template>
    <div style="padding: 5px;">
        <van-collapse v-model="activeName" accordion>
            <van-collapse-item :title="data.CompanyName" name="1" style="overflow: auto;">
                <router-link :to="'/FKCompanyListSecond?CompanyNo='+item.CompanyNo+'&CompanyName='+item.CompanyName" v-for="(item, index) in data.child" :key="index" >
                    <div style="margin-bottom: 10px;border-bottom: 1px solid #e8f1f8;" @click="">
                    <h1 :class="index==0?'f1':'f2'">{{ item.CompanyName }}</h1>
                    <!-- <h1 class="f1">{{ item.CompanyName }}</h1> -->
                    <div style="display: flex;margin-left: 1rem;">
                        <span style="flex: 1;color:#ff1919" >重大&nbsp;&nbsp;&nbsp;{{ item.MajorRiskCnt }}</span>
                        <span style="flex: 1;color: #f25637;">较大&nbsp;&nbsp;&nbsp;{{ item.MajorRiskCnt }}</span>
                        <span style="flex: 1;color: #E6BD1A;">一般&nbsp;&nbsp;&nbsp;{{ item.MajorRiskCnt }}</span>
                        <span style="flex: 1;color: #00bfdc;">低&nbsp;&nbsp;&nbsp;{{ item.MajorRiskCnt }}</span>
                    </div>
                </div>
                </router-link>
            </van-collapse-item>
        </van-collapse>
    </div>
</template>

<script>
import { ref } from 'vue';

// import test from './test.json'
export default {
    setup() {
        const activeName = ref('1');
        return { activeName };
    },
    data() {
        return {
            data: {
                isFkManager:false
            }
            
        }
    },
    created() {
        //测试数据
        // this.data = test.data[0]
        // this.data.child = test.data.slice(1)
        this.isFkManager=this.$store.state.isFkManager
        this.$axios.get('/UserCompanyOrg/GetUserCompanyOrgList').then(res=>{
            this.data= Object.assign({}, res.data[0])
            this.data.child=res.data

        })

    },
    methods: {

    }
}
</script>

<style lang="less" scoped>

.f1{
    font-weight:200;
    font-size:x-large
}
.f2{
    font-weight:100;
    font-size:large
}
</style>